class CreateObjectAndResourceClasses < ActiveRecord::Migration
  def self.up
    create_table :object_and_resource_classes do |t|
      t.integer :parent_id, :null => false, :default => 0
      t.integer :position
      t.string :name
      t.text :description
      t.string :sub_classes, :null => false, :default => '0000'
      t.integer :distribution, :null => false, :default => 0

      t.timestamps
    end
    add_index(:object_and_resource_classes, :parent_id)
  end

  def self.down
    drop_table :object_and_resource_classes
  end
end
